package com.video.controller;

import com.video.service.TypeServiceI;
import com.video.service.UserServiceI;
import com.video.utils.ResultMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class TypeController {

    @Autowired
    private TypeServiceI typeServiceI;

    @RequestMapping("/selectAllTypeByLimit")
    @ResponseBody
    public ResultMap selectAllTypeByLimit(int page,int limit){
        return typeServiceI.selectAllTypeByLimit(page,limit);
    }

    @RequestMapping("/selectAllType")
    @ResponseBody
    public ResultMap selectAllType(){
        return typeServiceI.selectAllType();
    }

    @RequestMapping("/createType")
    @ResponseBody
    public ResultMap createType(String typeStr){
        return typeServiceI.createType(typeStr);
    }

    @RequestMapping("/deletetypeByTid")
    @ResponseBody
    public ResultMap deletetypeByTid(String tId){
        return typeServiceI.deletetypeByTid(tId);
    }

    @RequestMapping("/updatetypeByTId")
    @ResponseBody
    public ResultMap updatetypeByTId(String typeStr){
        return typeServiceI.updatetypeByTId(typeStr);
    }
}
